1 //+-----------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // Defines the ClassFactory of PresentationHost.
12 // Ported Windows->DevDiv. See SourcesHistory.txt.
14 //------------------------------------------------------------------------
18 //******************************************************************************
20 // CClassFactory class definition
22 //******************************************************************************
26 class CClassFactory
: public IClassFactory
29 static DWORD s_dwRegistrationToken
[MAX_TOKENS
];
30 static LPCLSID s_clsIdActivated
;
36 HRESULT
RegisterClassObject(DWORD
& dwRegistrationToken
);
37 void SetActivatedClsId(__in REFCLSID clsId
) { s_clsIdActivated
= (LPCLSID
) &clsId
; }
40 CClassFactory(const CClassFactory
&src
); // not implemented
41 void operator=(const CClassFactory
&src
); // not implemented
43 CClassFactory(__in REFCLSID clsId
);
46 // Methods for registering/unregistering CLSIDs
47 static HRESULT
RegisterClassObjects();
48 static void RevokeAllClassObjects();
49 static LPCLSID
GetActivatedClsId() { return CClassFactory::s_clsIdActivated
; }
52 STDMETHODIMP
QueryInterface(REFIID
, __out LPVOID
*);
53 STDMETHODIMP_(DWORD
) AddRef();
54 STDMETHODIMP_(DWORD
) Release();
56 //IClassFactory methods
57 STDMETHODIMP
CreateInstance(__in LPUNKNOWN
, REFIID
, __out LPVOID
*);
58 STDMETHODIMP
LockServer(BOOL
);